import 'dart:convert';

import 'base_request.dart';

class CoreResponse{

  CoreResponse(this.request, this.statusCode, this.stausMessage, this.data);

  BaseRequest request;

  int? statusCode;

  String? stausMessage;

  dynamic data;

  @override
  String toString() {

    if(data is Map){
      return json.encode(data);
    }
    return data.toString();
  }


}


abstract class NetResponse<T>{

  NetResponse(this.code, this.msg, this.data);

  String? code;

  String? msg;

  T? data;

  bool isOk();

  @override
  String toString() {
    if(data is Map){
      return json.encode(data);
    }
    return data.toString();
  }
}